/**
* @depends jquery.ui.js
*/

(function($) {

	$.user = {
	
		preferences: function( user_id, callback ) {
		
			$.wajax( 'User_PreferencesDialog', { id: user_id }, function( json ) {
				if( json.status != 'success' ) {
					return false;
				}
				var content = $(json.content);
				var prefs = $.window.create()
					.window( {
						title: 'Preferences'
						
					} );
				prefs.window( 'content', content );
				prefs.action_user_preferences();
				prefs.window( 'open' );
			} );
		},
		
		picture: function( user_id, callback ) {
		
			$.wajax( 'User_PictureDialog', { id: user_id }, function( json ) {
				if( json.status != 'success' ) {
					return false;
				}
				var content = $(json.content);
				var prefs = $.window.create()
					.window( {
						title: 'Profile picture'
						
					} );
				prefs.window( 'content', content );
				prefs.action_user_picture();
				prefs.window( 'open' );
			} );
		}
	};
	
})(jQuery);
